x3ptools is available from CRAN:
The development version is available from Github:
The x3p file format is an xml based file format created to describe digital surface measurements. x3p has been developed by OpenFMC (Open Forensic Metrology Consortium, see http://www.openfmc.org/) and has been adopted as ISO ISO5436 – 2000. x3p files are a zip archive of a directory consisting of an xml file of meta information and a matrix of numeric surface measurements.
Internally, x3p objects are stored as a list consisting of the surface matrix (the measurements) and meta information in four records: header info, feature info, general info, and matrix info:
## [1] "header.info" "surface.matrix" "feature.info" "general.info"
## [5] "matrix.info"
The four info objects specify the information for Record1 through Record4 in the xml file. An example for an xml file is provided with the package and can be accessed as system.file("templateXML.xml", package="x3ptools").
header.info contains the information relevant to interpret locations for the surface matrix:
## $sizeY
## [1] 419
##
## $sizeX
## [1] 741
##
## $incrementY
## [1] 6.45e-07
##
## $incrementX
## [1] 6.45e-07
matrix.info expands on header.info and provides the link to the surface measurements in binary format.
general.info consists of information on how the data was captured, i.e. both author and capturing device are specified here.
feature.info is informed by the header info and provides the structure for storing the information.
While these pieces can be changed and adapted manually, it is more convenient to save information on the capturing device and the creator in a separate template and bind measurements and meta information together in the command addtemplate_x3p.